<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    img {
      width: 100px;
      height: 40px;
    }
  </style>
</head>
<body>
  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  <h1>学员管理系统</h1>
  <ul></ul>
  <script>
    let ul = document.querySelector('ul')

    axios.get('http://localhost:3000/students')
    .then(res => {
      console.log(res.data.data)
      let str = ''
      res.data.data.forEach(item => {
        str += `
          <li>
            <img src="http://localhost:3000/${item.avatar}">
            ${item.id}--${item.username} --${item.age}
          </li>
        `
      });
      ul.innerHTML = str
    })
    .catch(err => {
      console.error(err);
    })
  </script>
</body>
</html>